import "@/css/modules/rz_layer.scss"

let template = _.template('<div class="rz-layer">\
            <% if(type=="error") { %>\
                <div class="rz-layer__icon rz-layer__close"></div>\
            <% } else { %>\
                <div class="rz-layer__icon rz-layer__warn"></div>\
            <% } %>\
            <div class="rz-layer__title"><%= title %></div>\
            <div class="rz-layer__body">\
                <div class="layer-text">\
                    <p class="layer-text__title">原因</p>\
                    <ul class="layer-text__content">\
                        <% _.forEach(reason,function(item,index){ %>\
                            <li><%= item %></li>\
                        <% }) %>\
                    </ul>\
                </div>\
            </div>\
            <div class="rz-layer__label">请认真阅读驳回原因，上传次数过多将降低认证通过率</div>\
    </div>')


const RzLayer = function (opts) {
    let data = Object.assign({
        title: "提示",
        type: "warn",
        reason: []
    }, opts);

    return template(data)
}

export default RzLayer;